import React, { Component } from 'react'
interface ISate{
    name:string,
    age:number
}
//在react里对类有专门的约束 在Compoment这里约束Component<约定属性，约定状态>
export default class app extends Component<any,ISate> {
    state:ISate={
        name:'lvziqiaio',age:100
    }
  render() {
    return (
      <div>app -{this.state.name.substring(0,1).toUpperCase()+this.state.name.substring(1)}
      <button onClick={()=>{
        this.setState({name:"liaoziqiao"})
      }}>点击改变</button>
      </div>
    )
  }
}
